﻿//
// Created: 2018/9/6
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.Util;

namespace Model.Util.Map
{
    internal  class CategoryAttrMap:EntityTypeConfiguration< CategoryAttr >    
    {
        public CategoryAttrMap()
        {
             this.ToTable("CategoryAttr");
             this.HasKey(i => new { i.AttrId });
             this.Property(i => i.AttrId).HasColumnName("AttrId");                     
             this.Property(i => i.Name).HasColumnName("Name");                     
             this.Property(i => i.CategoryID).HasColumnName("CategoryID");                     
             this.Property(i => i.AttrGroupId).HasColumnName("AttrGroupId");                     
             this.Property(i => i.ShowType).HasColumnName("ShowType");                     
             this.Property(i => i.Isfilter).HasColumnName("Isfilter");                     
             this.Property(i => i.DisplayOrder).HasColumnName("DisplayOrder");                     
        }   
    }
    
     public static class CategoryAttrMapExtensions
    {
        public static void UserCategoryAttrMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new CategoryAttrMap());
        }
    }
}